package com.example.entity;

import javax.persistence.*;

import com.example.base.Cache.*;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;

import java.io.Serializable;


//@NamedStoredProcedureQueries({
//		@NamedStoredProcedureQuery(name = "stockoutmsg", procedureName = "ebm.stockoutmsg", parameters = {
//				@StoredProcedureParameter(mode = ParameterMode.IN, name = "mtime", type = String.class),
//				@StoredProcedureParameter(mode = ParameterMode.IN,name = "format",type = String.class),
//				@StoredProcedureParameter(mode = ParameterMode.IN,name = "devicetype",type = Integer.class)})
//})
@Entity
@Table(name = "daily_sales_statistics")
//@NamedStoredProcedureQuery(name = "stockoutmsg", procedureName = "ebm.stockoutmsg", parameters = {
//				@StoredProcedureParameter(mode = ParameterMode.IN, name = "mtime", type = String.class),
//				@StoredProcedureParameter(mode = ParameterMode.IN,name = "format",type = String.class),
//				@StoredProcedureParameter(mode = ParameterMode.IN,name = "devicetype",type = Integer.class)})
public class DailySalesStatistics extends BaseEntity implements Serializable, com.example.base.Cache.Cacheable {

	@Column(name = "product_type")
	private Integer productType;//设备类型
	
	@Column(name = "order_amount")
	private Integer orderAmount=0;//订单数目
	
	@Column(name = "substitution_amount")
	private Integer substitutionAmount;//置换数目
	
	@Column(name = "ems_amount")
	private Integer emsAmount;//会销数目
	
	@Column(name = "actual_stockout_amount")
	private Integer actualStockoutAmount=0;//实际出库数
	
	@Column(name = "exchange_amount")
	private Integer exchangeAmount;//换货数目
	
	@Column(name = "return_amount")
	private Integer returnAmount;//退货数目
	
	@Column(name = "statistics_total")
	private Integer statisticsTotal=0;//统计总数
	
	@Column(name = "stockout_total")
	private Integer stockoutTotal;//出库总数
	
	@Column(name = "repeat_stockout")
	private Integer repeatStockout;//重复出库数
	
	@Column(name = "statistical_time")
	private String statisticalTime;//统计时间
	
	@Column(name = "mstockin_sum")
	private Integer mstockinSum;//入库数量

	@Column(name = "actual_stockin_sum")
	private Integer actualstockinSum;//新建入库数量
	
	@Column(name = "return_stockin_sum")
	private Integer returnstockinSum;//返厂入库数量
	
	@Column(name = "exchange_stockin_sum")
	private Integer exchangestockinSum;//换货入库数量
	
	@Column(name = "sub_stockin_sum")
	private Integer substockinSum;//置换入库数量
	
	@Column(name = "remarks")
	private String remarks;//备注
	
	@Column(name = "stock_count")
	private String stockCount;//库存数量
	
	@Column(name = "return_factory_sum")
	private Integer returnFactorySum;//返厂数量
	
	public Integer getProductType() {
		return productType;
	}

	public void setProductType(Integer productType) {
		this.productType = productType;
	}

	public Integer getOrderAmount() {
		return this.orderAmount;
	}

	public void setOrderAmount(Integer orderAmount) {
		this.orderAmount = orderAmount;
	}
	
	public Integer getSubstitutionAmount() {
		return this.substitutionAmount;
	}

	public void setSubstitutionAmount(Integer substitutionAmount) {
		this.substitutionAmount = substitutionAmount;
	}
	
	public Integer getEmsAmount() {
		return this.emsAmount;
	}

	public void setEmsAmount(Integer emsAmount) {
		this.emsAmount = emsAmount;
	}
	
	public Integer getActualStockoutAmount() {
		return this.actualStockoutAmount;
	}

	public void setActualStockoutAmount(Integer actualStockoutAmount) {
		this.actualStockoutAmount = actualStockoutAmount;
	}

	public Integer getExchangeAmount() {
		return this.exchangeAmount;
	}

	public void setExchangeAmount(Integer exchangeAmount) {
		this.exchangeAmount = exchangeAmount;
	}
	
	public Integer getReturnAmount() {
		return this.returnAmount;
	}

	public void setReturnAmount(Integer returnAmount) {
		this.returnAmount = returnAmount;
	}
	
	public Integer getStatisticsTotal() {
		return this.statisticsTotal;
	}

	public void setStatisticsTotal(Integer statisticsTotal) {
		this.statisticsTotal = statisticsTotal;
	}
	
	public Integer getStockoutTotal() {
		return this.stockoutTotal;
	}

	public void setStockoutTotal(Integer stockoutTotal) {
		this.stockoutTotal = stockoutTotal;
	}
	
	public Integer getRepeatStockout() {
		return this.repeatStockout;
	}

	public void setRepeatStockout(Integer repeatStockout) {
		this.repeatStockout = repeatStockout;
	}
	
	public String getStatisticalTime() {
		return this.statisticalTime;
	}

	public void setStatisticalTime(String statisticalTime) {
		this.statisticalTime = statisticalTime;
	}
	
	public Integer getMstockinSum() {
		return mstockinSum;
	}

	public void setMstockinSum(Integer mstockinSum) {
		this.mstockinSum = mstockinSum;
	}

	public String getRemarks() {
		return remarks;
	}

	public void setRemarks(String remarks) {
		this.remarks = remarks;
	}

	public String getStockCount() {
		return stockCount;
	}

	public void setStockCount(String stockCount) {
		this.stockCount = stockCount;
	}

	public Integer getActualstockinSum() {
		return actualstockinSum;
	}

	public void setActualstockinSum(Integer actualstockinSum) {
		this.actualstockinSum = actualstockinSum;
	}

	public Integer getReturnstockinSum() {
		return returnstockinSum;
	}

	public void setReturnstockinSum(Integer returnstockinSum) {
		this.returnstockinSum = returnstockinSum;
	}

	public Integer getExchangestockinSum() {
		return exchangestockinSum;
	}

	public void setExchangestockinSum(Integer exchangestockinSum) {
		this.exchangestockinSum = exchangestockinSum;
	}

	public Integer getSubstockinSum() {
		return substockinSum;
	}

	public void setSubstockinSum(Integer substockinSum) {
		this.substockinSum = substockinSum;
	}

	public Integer getReturnFactorySum() {
		return returnFactorySum;
	}

	public void setReturnFactorySum(Integer returnFactorySum) {
		this.returnFactorySum = returnFactorySum;
	}

	public String toString() {
		return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
			.append("Id",getId())
			.append("ProductType",getProductType())
			.append("OrderAmount",getOrderAmount())
			.append("SubstitutionAmount",getSubstitutionAmount())
			.append("EmsAmount",getEmsAmount())
			.append("ActualStockoutAmount",getActualStockoutAmount())
			.append("ExchangeAmount",getExchangeAmount())
			.append("ReturnAmount",getReturnAmount())
			.append("StatisticsTotal",getStatisticsTotal())
			.append("StockoutTotal",getStockoutTotal())
			.append("RepeatStockout",getRepeatStockout())
			.append("statisticalTime",getStatisticalTime())
		    .append("Creater",super.getCreater())
			.append("CreateTime",super.getCreateTime())
			.append("Updater",super.getUpdater())
			.append("UpdateTime",super.getUpdateTime())
			.append("RecStatus",super.getRecStatus())
			.toString();
	}
	
	public DailySalesStatistics() {
		super();
	}

	public DailySalesStatistics(DailySalesStatistics dss,ProductType productType) {
		this.actualStockoutAmount=(dss.getActualStockoutAmount()==null?0:dss.getActualStockoutAmount());
		this.emsAmount=dss.getEmsAmount();
		this.exchangeAmount=(dss.getExchangeAmount());
		this.orderAmount=(dss.getOrderAmount()==null?0:dss.getOrderAmount());
		this.productType=productType.getId().intValue();
		this.repeatStockout=dss.getRepeatStockout();
		this.returnAmount=dss.getReturnAmount();
		this.mstockinSum=dss.getMstockinSum();
		this.actualstockinSum=dss.getActualstockinSum()==null?0:dss.getActualstockinSum();
		this.returnstockinSum=dss.getReturnstockinSum()==null?0:dss.getReturnstockinSum();
		this.exchangestockinSum=dss.getExchangestockinSum()==null?0:dss.getExchangestockinSum();
		this.substockinSum=dss.getSubstockinSum()==null?0:dss.getSubstockinSum();
		this.statisticalTime=dss.getStatisticalTime();
		this.statisticsTotal=(dss.getStatisticsTotal()==null?0:dss.getStatisticsTotal());
		this.stockoutTotal=dss.getStockoutTotal();
		this.substitutionAmount=dss.getSubstitutionAmount();
		this.stockCount=dss.getStockCount();
		this.returnFactorySum=dss.getReturnFactorySum()==null?0:dss.getReturnFactorySum();
	}
	
}
